package top.wardyan.wmes.rfid.kqa.dto;

/**
 * @author ericl
 * @CreateTime 2022/1/26 14:15
 * @Description
 */
public class BasicCmd28DisplayRow {
    /** 第n行 **/
    private Integer rowNum;
    /** 28号基础控制指令,当rowNum = 210时，赋值 **/
    private BasicCmd28 basicCmd28;
    /** 第n行内容 **/
    private String rowContent;
    /** 是否修改颜色:0 不修改 1 修改 **/
    private Integer updateColor;
    /** 颜色，当updateColor=0时，不填 **/
    private String color;

    public BasicCmd28DisplayRow(Integer rowNum, String rowContent) {
        this.rowNum = rowNum;
        this.rowContent = rowContent;
        this.updateColor = 0;
    }

    public BasicCmd28DisplayRow(Integer rowNum, String rowContent, String color) {
        this.rowNum = rowNum;
        this.rowContent = rowContent;
        this.updateColor = 1;
        this.color = color;
    }

    public BasicCmd28DisplayRow(Integer rowNum, BasicCmd28 basicCmd28) {
        this.rowNum = rowNum;
        this.basicCmd28 = basicCmd28;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(rowNum);
        if (rowNum == 210){
            sb.append("|").append(basicCmd28.toString());
        }else {
            sb.append("|").append(rowContent).append("|").append(updateColor);
            if(updateColor == 1){
                sb.append("|").append(color);
            }
        }
        return sb.toString();
    }

	public Integer getRowNum() {
		return rowNum;
	}

	public BasicCmd28DisplayRow setRowNum(Integer rowNum) {
		this.rowNum = rowNum;
		return this;
	}

	public BasicCmd28 getBasicCmd28() {
		return basicCmd28;
	}

	public BasicCmd28DisplayRow setBasicCmd28(BasicCmd28 basicCmd28) {
		this.basicCmd28 = basicCmd28;
		return this;
	}

	public String getRowContent() {
		return rowContent;
	}

	public BasicCmd28DisplayRow setRowContent(String rowContent) {
		this.rowContent = rowContent;
		return this;
	}

	public Integer getUpdateColor() {
		return updateColor;
	}

	public BasicCmd28DisplayRow setUpdateColor(Integer updateColor) {
		this.updateColor = updateColor;
		return this;
	}

	public String getColor() {
		return color;
	}

	public BasicCmd28DisplayRow setColor(String color) {
		this.color = color;
		return this;
	}
}
